/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.google.code.jmarias.server.phases;

import com.google.code.jmarias.common.NewPlayer;
import com.google.code.jmarias.common.NewTable;
import com.google.code.jmarias.common.action.ChooseSuitAction;
import com.google.code.jmarias.common.action.SayBadAction;
import com.google.code.jmarias.common.action.SignedAction;
import com.google.code.jmarias.server.tcp.MariasGame;

/**
 *
 * @author josef
 */
public class DealerDecisionPhase extends NewAbstractPhase {

    public DealerDecisionPhase(NewPlayer playingNow) {
        super(playingNow);

        addListener(new ActionListener(ChooseSuitAction.class) {

            @Override
            protected NewAbstractPhase processAction(SignedAction action, NewTable table) {

                broadcast(action);

                // broadcast barva trumfu

                throw new RuntimeException("Zpracovani akce ChooseSuitAction dosud neimplementovano");
            }
        });

        addListener(new ActionListener(SayBadAction.class) {

            @Override
            protected NewAbstractPhase processAction(SignedAction action, NewTable table) {

                throw new RuntimeException("Zpracovani akce SayBadAction dosud neimplementovano");
            }
        });
    }

    @Override
    public String toString() {
        return "Druhy hrac obrany rika barvu.";
    }
    
//    public DealerDecisionPhase() {
//    }
//
//    @Override
//    public AbstractPhase processSayBadAction(SayBadAction action) {
//        table.getClients().get(2).sendMessage(new SendTalonAction(table.getTalon()));
//        Player[] players = table.getPlayers();
//        Card[] talon = new Card[2];
//        for (int i = 0; i < table.getTalon().size(); i++) {
//            talon[i] = table.getTalon().get(i);
//        }
//        players[2].addCardsToHand(talon);
//        return new BadTalonDroppingPhase(2);
//    }
//
//    @Override
//    public AbstractPhase processChooseSuitAction(ChooseSuitAction action) {
//        table.getClients().get(2).sendMessage(new AskForChoiceAction(0));
//        return null;
//    } //odsud se bude pokracovat do normalni hry
}
